package main

func main() {
	println(isAnagram("anagram", "nagaram"))
}

func isAnagram(s string, t string) bool {
	if len(s) != len(t) {
		return false
	}
	var saum [26]int
	for _, i := range []rune(s) {
		saum[i-97]++
	}
	for _, i := range []rune(t) {
		saum[i-97]--
	}
	flag := true
	for _, i := range saum {
		if i != 0 {
			flag = false
		}
	}

	return flag
}
